package com.gengine.resource
{
	import com.gengine.resource.info.*;
	import flash.system.*;
	import flash.utils.*;
	
	public class ResourceManager extends Object
	{
		private static var _resourceNameMap:Dictionary = new Dictionary();
		private static var _instance:ResourceManager;
		
		public function ResourceManager()
		{
			
		}
		
		public static function addResource(param1:ResourceInfo) : void
		{
			_resourceNameMap[param1.name] = param1;
			
		}
		
		public static function removeResource(param1:ResourceInfo) : void
		{
			delete _resourceNameMap[param1.name];
			
		}
		
		public static function getInfoByName(param1:String) : ResourceInfo
		{
			return _resourceNameMap[param1] as ResourceInfo;
		}
		
		public static function hasInfoByName(param1:String) : Boolean
		{
			return param1 in _resourceNameMap;
		}
		
		public static function disposeAll() : void
		{
			var _loc_1:ResourceInfo = null;
			for each (_loc_1 in _resourceNameMap)
			{
				
				_loc_1.dispose();
			}
			System.gc();
			
		}
		
	}
}
